layui.define(['element', 'layer', 'jquery', 'form','laydate','laypage'], function(exports) {
	var element = layui.element(),
		layer = layui.layer,
		$ = layui.jquery,
		form = layui.form(),
		laydate = layui.laydate,
		laypage = layui.laypage,
		$pageId = $("#page"),
		$pagesNum = parseInt($("#page").attr("data-page")),
		$page;

	    $pageId.prev().css('padding-bottom','60px')
		  laypage({
		    cont: $pageId
		    ,pages: $pagesNum
		    ,skip: true
		    ,first:1
		    ,skin:'#f76535'
		    ,prev: '<em>&lt;</em>'
		    ,next: '<em>></em>'
		    ,curr: function(){ //通过url获取当前页，也可以同上（pages）方式获取
    			$page = $('input[name="page"]').val()/*location.search.match(/page=(\d+)/)*/;
    			return $page ? $page : 1;
    			
    		}()
    		,jump: function(e, first){ //触发分页后的回调
    			if(!first){ //一定要加此判断，否则初始时会无限刷新
    				/*location.href = $javaUrl+e.curr;*/
    				$('#page_for input[name="page"]').val(e.curr);
    				$('#page_for').submit();
    			}
    		}
		  });

	exports('xbzx-cms-form', {}); //注意，这里是模块输出的核心，模块名必须和use时的模块名一致
});
